package cn.aylog.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
// 具有极大的兼容性/容错性，以下集中方式都可一定位到具体地址
// @RequestMapping("/hello/*")
// @RequestMapping("/hello")
// @RequestMapping("/hello/")
public class HelloController {

    @RequestMapping("/")
    public String helloThymeleaf() {
        return "index";
    }

    @RequestMapping("/target")
    public String toTarget() {
        return "target";
    }

    // 转发在服务器内部进行
    @RequestMapping("/aa")
    public String testRedirect() {
        return "redirect:/target";
    }
}
